package de.dhbw.ka.tit09.picsim.model;

/**
 * Representation of an assembler instruction.
 * 
 * @author Andreas Bender
 * 
 */
public class Command {
	private int code;
	private int line;

	/**
	 * Constructor.
	 * 
	 * @param code operation code of the instruction.
	 * @param line line of the instruction in the source file
	 */
	public Command(int code, int line) {
		this.code = code;
		this.line = line;
	}

	/**
	 * Returns the operation code of the instruction.
	 * 
	 * @return the operation code
	 */
	public int getCode() {
		return code;
	}

	/**
	 * Sets the operation code of the instruction.
	 * 
	 * @param code the operation code
	 */
	public void setCode(int code) {
		this.code = code;
	}

	/**
	 * Returns the line in the source file where the instruction can be found.
	 * 
	 * @return the line number
	 */
	public int getLine() {
		return line;
	}

	/**
	 * Sets the instruction line number.
	 * 
	 * @param line the line number of the instruction
	 */
	public void setLine(int line) {
		this.line = line;
	}
}
